Code duplication here aswell