ticket:5 code cleanup