refactor for nicer syntax