Cleaned up and added unit tests