refactored stuff!