Refactor helpers and models