Refactoring code

Note for gabe_* files: were made today as practice/working along with Gabe.