Cleaned up code, test have their own file