commit semi refactored code