Updated tests and refactored package