refactor
optimize
remove unused vars