Feature/code cleanup

Please review my code cleanup. I didn't do any architectural changes yet, it's only about better readability and maintainability for now.