Refactor/best practice minor fixes