Fix minor code refactoring tasks