refactor: grunt, tests, less code