changed to one function per file approach