Some refactor and cleanup
ALPHA 1
BETA 1