Refactor to simplfy