cleanup code + making it look a little nicer