Refactor apply to be less huge