little bit of code cleaning but still needs to be reviewed, I also added a todo list to the wishlist