add composer support + refactoring + code cleanup