more refactor and cleaning stuff up