Working commit. Start some refactoring & code improvement.
Working commit. Move some code to methods.