finish refactor, decent dyanmics