refactored interfacees and added phpdoc