Coding style, refactoring & Bugfix