Cleanup code a bit

De-inline methods, whitespaces fixes, etc.