added tests and changed some styles, added helper