shortening functions, moving boilerplate functions to separate files