refactor, extract method, renames. made some methods inline