dont return with object literal in constructor method

added test to verify it, moved methods out of constructor