Refactor code. #7