more refactoring. split things up into folder.