Extracted user related entities into interfaces. Cleaned up code style a bit