- refactored a bit