Cleaned up the code base by spliting it up in seperate files.
Fixed func argument order.