Factorized some code, fixed bugs