Fill code coverage by tests and refactor code