add composer support + refactoring + code cleanup
add composer support + refactoring + code cleanup