Refactoring code. Commit 2.