Cleanup code to comply with Qt style