Color hell fix. Fix bug #10. Code refactoring.