code is much more readable now, need to refactor db