some more renaming and modularizing