refactored tests and new features