Fixed bugs, refactored names and removed useless parameters