collapsing methods and re-organizing lines
refactoring a bit