Code refactoring
Updated tests
Added TODO-s based on test result