Refactoring

My humble attempt to make the code look a little bit better.