Refactor due to recent changes