refactor for easier use