Added constructors, refactored a bit