code cleanup, refactoring for data binding